package com.sti.platform.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.aisino.core.dao.BaseDao;
import com.aisino.tools.enums.PageEnum;
import com.aisino.tools.enums.QlEnum;
import com.aisino.tools.util.page.Page;
import com.sti.platform.dao.CompanyDao;
import com.sti.platform.model.Company;

@Repository
public class CompanyDaoImpl extends BaseDao implements CompanyDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<Company> queryList(String sql, Page page) {
		Integer total = super.getTotalCount(sql, null, null,  QlEnum.SQL);
		page.setTotal(total);
		
		return super.getByHibernateQuery(sql, null, null, 1000,
				page, Company.class,QlEnum.SQL, PageEnum.PAGE_YES).getRecord();
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Company> queryCompany(String sql) {
		return super.getBySql(sql, Company.class);
	}

}
